home *** CD-ROM | disk | FTP | other *** search
/ Take-Home Tutor en Espanol / TakeHomeTutor.iso / pc / En espanol / Take-Home Tutor 3 / flipcard_u3e2.swf / scripts / DefineButton2_167 / BUTTONCONDACTION on(release).as
Encoding:
Text File  |  2003-10-29  |  2.2 KB  |  71 lines

  1. on(release){
  2.    if(activeMCList.length > 1)
  3.    {
  4.       stopAllSounds();
  5.       arraythang = _root.activeMCList;
  6.       placearray = new Array();
  7.       newthang = new Array();
  8.       a = 0;
  9.       while(a < arraythang.length)
  10.       {
  11.          placearray.push(a);
  12.          a++;
  13.       }
  14.       a = 0;
  15.       while(a < arraythang.length)
  16.       {
  17.          do
  18.          {
  19.             trg = random(placearray.length);
  20.             newplace = placearray[trg];
  21.          }
  22.          while(arraythang[a] == arraythang[newplace] && a != arraythang.length - 1);
  23.          
  24.          placearray.splice(trg,1);
  25.          if(arraythang[a] != arraythang[newplace])
  26.          {
  27.             newthang.push(arraythang[newplace]);
  28.          }
  29.          else
  30.          {
  31.             newthang.unshift(arraythang[newplace]);
  32.          }
  33.          a++;
  34.       }
  35.       _root.activeMCList = newthang;
  36.       _root.activeMC = _root.activeMCList.shift();
  37.       _root.activeMClist.push(_root.activeMC);
  38.       tellTarget("_root.dynamicbuttonMc")
  39.       {
  40.          setProperty("frontAudioInstance", _visible, false);
  41.          setProperty("backAudioInstance", _visible, false);
  42.          setProperty("frontImageHolderInstance", _visible, false);
  43.          setProperty("backImageHolderInstance", _visible, false);
  44.          var question = _root.frontArray[_root.activeMC];
  45.          var answer = _root.backArray[_root.activeMC];
  46.          var frontAudio = _root.frontAudioArray[_root.activeMC];
  47.          var backAudio = _root.backAudioArray[_root.activeMC];
  48.          var frontImage = _root.frontImageArray[_root.activeMC];
  49.          var backImage = _root.backImageArray[_root.activeMC];
  50.          setProperty("_root.flipcursor1", _visible, false);
  51.          gotoAndPlay(1);
  52.       }
  53.       tellTarget("_root.randomizeMC")
  54.       {
  55.          gotoAndPlay(1);
  56.       }
  57.       tellTarget("_root.dynamicbuttonMc")
  58.       {
  59.          gotoAndPlay(1);
  60.       }
  61.    }
  62.    else if(_root.activeTotal = 1)
  63.    {
  64.       tellTarget("_root.noRandomMC")
  65.       {
  66.          gotoAndPlay(1);
  67.       }
  68.    }
  69.    cardlisting = "Tarjeta: <font color =\"#6868CE\">" + _root.passiveMC + "</font>" + " de " + "<font color =\"#6868CE\">" + _root.activeTotal + "</font>";
  70. }
  71.